<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
SuggestOracle.Suggestion (Google Web Toolkit Javadoc)
</TITLE>

<META NAME="keywords" CONTENT="com.google.gwt.user.client.ui.SuggestOracle.Suggestion interface">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="SuggestOracle.Suggestion (Google Web Toolkit Javadoc)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.Response.html" title="class in com.google.gwt.user.client.ui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/TabBar.html" title="class in com.google.gwt.user.client.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/gwt/user/client/ui/SuggestOracle.Suggestion.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SuggestOracle.Suggestion.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.gwt.user.client.ui</FONT>
<BR>
Interface SuggestOracle.Suggestion</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../com/google/gwt/user/client/ui/MultiWordSuggestOracle.MultiWordSuggestion.html" title="class in com.google.gwt.user.client.ui">MultiWordSuggestOracle.MultiWordSuggestion</A></DD>
</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.html" title="class in com.google.gwt.user.client.ui">SuggestOracle</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public static interface <B>SuggestOracle.Suggestion</B></DL>
</PRE>

<P>
Suggestion supplied by the
 <A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.html" title="class in com.google.gwt.user.client.ui"><CODE>SuggestOracle</CODE></A>. Each suggestion has a
 display string and a replacement string. The display string is what is
 shown in the SuggestBox's list of suggestions. The interpretation of the
 display string depends upon the value of its oracle's
 <A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.html#isDisplayStringHTML()"><CODE>SuggestOracle.isDisplayStringHTML()</CODE></A>. The replacement string is
 the string that is entered into the SuggestBox's text box when the
 suggestion is selected from the list.

 <p>
 Replacement strings are useful when the display form of a suggestion
 differs from the input format for the data. For example,
 suppose that a company has a webpage with a form which requires the user to
 enter the e-mail address of an employee. Since users are likely to know
 the name of the employee, a SuggestBox is used to provide name suggestions
 as the user types. When the user types the letter <i>f</i>, a suggestion
 with the display string <i>foo bar</i> appears. When the user chooses this
 suggestion, the replacement string, <i>foobar@company.com</i>, is
 entered into the SuggestBox's text box.
 </p>

 <p>
 This is an example where the input data format for the suggestion is not
 as user-friendly as the display format. In the event that the display
 of a suggestion exactly matches the input data format, the
 <code>Suggestion</code> interface would be implemented in such a way
 that the display string and replacement string would be identical.
 </p>

 <h3>Associating Data Transfer Objects (DTOs) with Suggestion Objects</h3>
 Some applications retrieve suggesstions from a server, and may want to send
 back a DTO with each suggestion. In the previous example, a DTO returned
 with the suggestion may provide additional contact information about the
 selected employee, and this information could be used to fill out other
 fields on the form. To send back a DTO with each suggestion, extend the
 <code>Suggestion</code> interface and define a getter method that has
 a return value of the DTO's type. Define a class that implements this
 subinterface and use it to encapsulate each suggestion.

 <p>
 To access a suggestion's DTO when the suggestion is selected, add a
 <A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestionHandler.html" title="interface in com.google.gwt.user.client.ui"><CODE>SuggestionHandler</CODE></A> to the SuggestBox (see SuggestBox's documentation
 for more information). In the
 <code>SuggestionHandler.onSuggestionSelected(SuggestionEvent event)</code>
 method, obtain the selected <code>Suggestion</code> object from the
 <A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestionEvent.html" title="class in com.google.gwt.user.client.ui"><CODE>SuggestionEvent</CODE></A> object, and downcast the <code>Suggestion</code>
 object to the subinterface. Then, acces the DTO using the DTO getter method
 that was defined on the subinterface.
 </p>
<P>

<P>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.Suggestion.html#getDisplayString()">getDisplayString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the display string associated with this suggestion.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.Suggestion.html#getReplacementString()">getReplacementString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the replacement string associated with this suggestion.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getDisplayString()"><!-- --></A><H3>
getDisplayString</H3>
<PRE>
java.lang.String <B>getDisplayString</B>()</PRE>
<DL>
<DD>Gets the display string associated with this suggestion. The
 interpretation of the display string depends upon the value of
 its oracle's <A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.html#isDisplayStringHTML()"><CODE>SuggestOracle.isDisplayStringHTML()</CODE></A>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the display string for this suggestion</DL>
</DD>
</DL>
<HR>

<A NAME="getReplacementString()"><!-- --></A><H3>
getReplacementString</H3>
<PRE>
java.lang.String <B>getReplacementString</B>()</PRE>
<DL>
<DD>Gets the replacement string associated with this suggestion. When
 this suggestion is selected, the replacement string will be entered
 into the SuggestBox's text box.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the string to be entered into the SuggestBox's text box when
         this suggestion is selected</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/SuggestOracle.Response.html" title="class in com.google.gwt.user.client.ui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/gwt/user/client/ui/TabBar.html" title="class in com.google.gwt.user.client.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?com/google/gwt/user/client/ui/SuggestOracle.Suggestion.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SuggestOracle.Suggestion.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
